<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>mclog系统安装 - Powered by Mclog!</title>
    <meta name="author" content="幽灵传说,mclog">
    <meta name="keywords" content="mclog">
    <link href="{$this->themeurl}/install.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="{$this->weburl}/static/js/jquery.min.js"></script>
    <script type="text/javascript">var url = '{$this->weburl}';</script>
    <script type="text/javascript" src="{$this->weburl}/static/js/mclog.js?v={echo time()}"></script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="brand" href="#">mclog {echo APP_VERSION} 系统安装</a>
        </div>
    </div>
</div>

<div class="container">
    <div id="db">
        <form class="form-horizontal" method="post" action="{$this->mc_url($c, '_db')}">
            <fieldset>
                <legend>MySQL设置</legend>
                <div class="control-group">
                    <label class="control-label">数据库地址：</label>
                    <div class="controls">
                        <input type="text" name="db[dbhost]" placeholder="请输入数据库地址" value="localhost" class="required">
                        <span>默认：(localhost)</span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">数据库名：</label>
                    <div class="controls">
                        <input type="text" name="db[dbname]" placeholder="请输入数据库名" class="required" value="mclog">
                        <p>程序不会自动创建数据库，请提前创建一个空数据库或使用已有数据库</p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">用户名：</label>
                    <div class="controls">
                        <input type="text" name="db[dbuser]" placeholder="请输入数据库用户名" class="required" value="mclog">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">密码：</label>
                    <div class="controls">
                        <input type="text" name="db[dbpass]" placeholder="请输入数据库用户密码" class="required" value="mclog">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">表前缀：</label>
                    <div class="controls">
                        <input type="text" class="required" name="db[dbprefix]" value="mc_" placeholder="请输入数据库表前缀" />
                        <p>通常默认即可，不必修改。由英文字母、数字、下划线组成，且必须以下划线结束</p>
                    </div>
                </div>

                <div class="control-group">
                    <div class="controls">
                        <button type="button" title="检查数据库连接" class="btn">下一步</button>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    <div id="admin" class="hide">
        <form class="form-horizontal" method="post" action="{$this->mc_url($c, '_install')}">
            <fieldset>
                <legend>管理员设置</legend>
                <div class="control-group">
                    <label class="control-label">用户名：</label>
                    <div class="controls">
                        <input type="text" name="user[author]" placeholder="请输入用户名" class="required username" value="root">
                        <p>3~15个字符，包括字母，数字，下划线以字母开头，字母或数字结尾</p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">用户密码：</label>
                    <div class="controls">
                        <input type="text" name="user[pass]" value="mclog" tip="只能输入5~12长度字符" match="^(.){5,12}$" placeholder="请输入密码" class="required identical">
                        <p>6~12个字符，区分大小写</p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">重复密码：</label>
                    <div class="controls">
                        <input type="text" name="pass1" value="mclog" tip="只能输入5~12长度字符" match="^(.){5,12}$" placeholder="请重复输入密码" class="required identical">
                        <p>6~12个字符，区分大小写</p>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <button type="button" class="btn">开始安装</button>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    <div id="install" class="hide">
        <fieldset>
            <legend>正在安装</legend>
        </fieldset>
        <div class="control-group notice"></div>
    </div>
    <div id="done" class="hide">
        <fieldset>
            <legend>安装完成</legend>
        </fieldset>
        <div class="control-group" style="text-align: center;">
            <p style="font-weight: bold; padding-bottom: 10px;">您的mclog已经安装好了，现在可以开始您的创作了，就这么简单!</p>
            <a class="btn" href="{$this->weburl}/">访问网站</a>
            <a class="btn" href="{$this->weburl}/admin">进入后台</a>
        </div>
    </div>
</div>
<!-- /container -->
<script type="text/javascript">mclog.include( 'static/js/install.js' );</script>
</body>
</html>